home *** CD-ROM | disk | FTP | other *** search
- package assets.effects
- {
- import flash.display.*;
- import flash.events.*;
-
- [Embed(source="/_assets/assets.swf", symbol="assets.effects.star1")]
- public class star1 extends MovieClip
- {
-
-
- private var count:Number = 0;
-
- public var clip:Object;
-
- public var scope:Object;
-
- private var dist:Number;
-
- private var spd:Number;
-
- private var ang:Number;
-
- public function star1(param1:*, param2:*)
- {
- count = 0;
- super();
- addFrameScript(0,frame1,5,frame6);
- clip = param1;
- scope = param2;
- ang = Math.round(Math.random() * 360) * (Math.PI / 180);
- dist = Math.round(Math.random() * 10);
- spd = Math.round(Math.random() * 10);
- scaleX = scaleY = 0.25 + Math.random() * 0.25;
- if(Math.round(Math.random()))
- {
- gotoAndStop("white");
- }
- addEventListener(Event.ENTER_FRAME,run);
- }
-
- private function removal() : *
- {
- removeEventListener(Event.ENTER_FRAME,run);
- clip.removeChild(this);
- }
-
- internal function frame6() : *
- {
- stop();
- }
-
- internal function frame1() : *
- {
- stop();
- }
-
- private function run(param1:Event) : *
- {
- var _loc2_:* = undefined;
- scaleX = scaleY = scaleY + 0.05;
- rotation += 2;
- x += spd * Math.cos(ang);
- y += spd * Math.sin(ang);
- _loc2_ = scope.vx * ((y - scope.pp.y) / scope.pp.y);
- x -= Math.abs(_loc2_);
- if(count < dist)
- {
- ++count;
- }
- else
- {
- removal();
- }
- }
- }
- }
-